<div class="tab-pane" id="tab_time">
    <div class="panel panel-default">
            <div class="panel-heading">
                商品限购
            </div>
            <div class="panel-body">
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">起售份数</label>
                    <div class="col-sm-9">
                        <div class="input-group">
                            <input type="text" name="startcount" class="form-control" value="{$item['startcount']}" />
                            <span class="input-group-addon">份</span>
                        </div>
                        <div class="help-block">必填</div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">每单可购买份数</label>
                    <div class="col-sm-9">
                        <div class="input-group">
                            <input type="text" name="endcount" class="form-control" value="{$item['endcount']}" />
                            <span class="input-group-addon">份</span>
                        </div>
                        <div class="help-block">必填</div>
                    </div>
                </div>
                <div class="form-group" style="display: none;">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">几份免单</label>
                    <div class="col-sm-9">
                        <div class="input-group">
                            <input type="text" name="freecount" class="form-control" value="{$item['freecount']}" />
                            <span class="input-group-addon">份</span>
                        </div>
                        <div class="help-block">注：购买的第一份需付费</div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">商品限星期购买</label>
                    <div class="col-sm-9">
                        <div style="border:1px #eee dashed; padding:10px;background:#F5F5F5;">
                            <label for="week1" class="checkbox-inline">
                                <input id="week1" type="checkbox" name="week[]" value="1" {if empty($item) || in_array(1, $weeks)}checked{/if}> 星期一
                            </label>
                            <label for="week2" class="checkbox-inline">
                                <input id="week2" type="checkbox" name="week[]" value="2" {if empty($item) || in_array(2, $weeks)}checked{/if}> 星期二
                            </label>
                            <label for="week3" class="checkbox-inline">
                                <input id="week3" type="checkbox" name="week[]" value="3" {if empty($item) || in_array(3, $weeks)}checked{/if}> 星期三
                            </label>
                            <label for="week4" class="checkbox-inline">
                                <input id="week4" type="checkbox" name="week[]" value="4" {if empty($item) || in_array(4, $weeks)}checked{/if}> 星期四
                            </label>
                            <label for="week5" class="checkbox-inline">
                                <input id="week5" type="checkbox" name="week[]" value="5" {if empty($item) || in_array(5, $weeks)}checked{/if}> 星期五
                            </label>
                            <label for="week6" class="checkbox-inline">
                                <input id="week6" type="checkbox" name="week[]" value="6" {if empty($item) || in_array(6, $weeks)}checked{/if}> 星期六
                            </label>
                            <label for="week7" class="checkbox-inline">
                                <input id="week7" type="checkbox" name="week[]" value="0" {if empty($item) || in_array(0, $weeks)}checked{/if}> 星期日
                            </label>
                        </div>
                    </div>
                </div>
                    <div class="form-group">
                        <label class="col-xs-12 col-sm-3 col-md-2 control-label">可售卖时间</label>
                        <div class="col-sm-9">
                            <div class="radio radio-info radio-inline">
                                <input type="radio" id="istime2" value="0" name="istime" {if $item['istime']==0}checked{/if}>
                                <label for="istime2"> 不限制时间 </label>
                            </div>
                            <div class="radio radio-info radio-inline">
                                <input type="radio" id="istime1" value="1" name="istime" {if $item['istime']==1}checked{/if}>
                                <label for="istime1"> 自定义时间 </label>
                            </div>
                            <div class="help-block"></div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-12 col-sm-3 col-md-2 control-label">日期范围</label>
                        <div class="col-sm-9">
                            {php echo tpl_form_field_daterange('datelimit', array('starttime'=>$starttime,'endtime'=>$endtime), true)}
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-12 col-sm-3 col-md-2 control-label">时间范围</label>
                        <div class="col-sm-3">
                            <div class="input-group clockpicker">
                                <input type="text" class="form-control" value="{$item['begintime']}" name="begintime">
                                <span class="input-group-addon">
                                <span class="glyphicon glyphicon-time"></span>
                                </span>
                            </div>
                        </div>
                        <div class="col-sm-3">
                            <div class="input-group clockpicker">
                                <input type="text" class="form-control" value="{$item['endtime']}" name="endtime">
                                <span class="input-group-addon">
                                <span class="glyphicon glyphicon-time"></span>
                                </span>
                            </div>
                        </div>
                    </div>
            </div>
    </div>
</div>
